home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 November / Macworld (1999-11).dmg / Shareware World / Utilities / User Interface / Golive [Font] / LaunchURL / Source / LaunchURL.c < prev    next >
C/C++ Source or Header  |  1998-08-18  |  715b  |  38 lines

  1. /*********************************************************************\
  2.  LaunchURL.c
  3.  © Dan Crevier, 1998
  4.  
  5.  Code for a OneClick extension to launch a URL
  6.  
  7.  LaunchURL theURL
  8.  
  9. \*********************************************************************/
  10.  
  11. #include "OC Extension.h"
  12.  
  13. #include "ICTypes.h"
  14. #include "ICAPI.h"
  15.  
  16. pascal void main(ExternalParameterRec *pXRef)
  17. {
  18.     valueRec    inURL;
  19.     ICInstance    inst;
  20.     
  21.     if (GetStringValue(pXRef, &inURL))
  22.     {
  23.         if (ICStart(&inst, '????') == noErr)
  24.         {
  25.             if (ICFindConfigFile(inst, 0, nil) == noErr)
  26.             {
  27.                 long selStart = 0, selEnd = inURL.len;
  28.                 ICLaunchURL(inst, "\p", inURL.p, inURL.len, &selStart, &selEnd);
  29.             }
  30.             ICStop(inst);
  31.         }
  32.         
  33.         DisposeValue(pXRef, &inURL);
  34.     }
  35.  
  36. }
  37.  
  38.